/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.qsdm.es.core;

import com.qsdm.es.persistence.*;
import java.util.List;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;

/**
 *
 * @author alberto
 */
public interface ServicesController {

    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    @RequestMapping(value = "/cformacion/update", method = RequestMethod.POST, headers = "Accept=application/json")
    @ResponseBody
    void actualizarCentroformacion(@RequestBody Centroformacion sp);

    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    @RequestMapping(value = "/comp/update", method = RequestMethod.POST, headers = "Accept=application/json")
    @ResponseBody
    void actualizarCompetencia(@RequestBody Competencia sp);

    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    @RequestMapping(value = "/elab/update/{usuario}", method = RequestMethod.POST, headers = "Accept=application/json")
    @ResponseBody
    void actualizarExperiencialaboral(@RequestBody Experiencialaboral sp, @PathVariable(value = "usuario") String usuario);

    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    @RequestMapping(value = "/formacion/update", method = RequestMethod.POST, headers = "Accept=application/json")
    @ResponseBody
    void actualizarFormacion(@RequestBody Formacion sp);

    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    @RequestMapping(value = "/formacion/update/{usuario}/{centro}/{anios}", method = RequestMethod.POST, headers = "Accept=application/json")
    @ResponseBody
    void actualizarFormacionUsuario(@RequestBody Formacion sp, @PathVariable(value = "usuario") String usuario, @PathVariable(value = "centro") String centro, @PathVariable(value = "anios") String anios);

    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    @RequestMapping(value = "/idioma/update", method = RequestMethod.POST, headers = "Accept=application/json")
    @ResponseBody
    void actualizarIdioma(@RequestBody Idioma sp);

    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    @RequestMapping(value = "/sp/update", method = RequestMethod.POST, headers = "Accept=application/json")
    @ResponseBody
    void actualizarSectorProfesional(@RequestBody Sectorprofesional sp);

    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    @RequestMapping(value = "/tContrato/update", method = RequestMethod.POST, headers = "Accept=application/json")
    @ResponseBody
    void actualizarTipocontrato(@RequestBody Tipocontrato sp);

    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    @RequestMapping(value = "/tformacion/update", method = RequestMethod.POST, headers = "Accept=application/json")
    @ResponseBody
    void actualizarTipoformacion(@RequestBody Tipoformacion sp);

    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    @RequestMapping(value = "/user/update", method = RequestMethod.POST, headers = "Accept=application/json")
    @ResponseBody
    void actualizarUsuario(@RequestBody Usuario sp);

    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    @RequestMapping(value = "/cformacion/delete/{usuario}/{formacion}", method = RequestMethod.POST, headers = "Accept=application/json")
    @ResponseBody
    void eliminarCentroformacion(@RequestBody Centroformacion sp, @PathVariable(value = "usuario") String usuario, @PathVariable(value = "formacion") String formacion);

    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    @RequestMapping(value = "/elab/{usuario}/{experiencia}", method = RequestMethod.DELETE, headers = "Accept=application/json")
    @ResponseBody
    void eliminarExperiencialaboral(@PathVariable(value = "usuario") String usuario, @PathVariable(value = "experiencia") String experiencia);

    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    @RequestMapping(value = "/formacion/delete/{usuario}/{formacion}", method = RequestMethod.POST, headers = "Accept=application/json")
    @ResponseBody
    void eliminarFormacionUsuario(@RequestBody Formacion sp, @PathVariable(value = "usuario") String usuario, @PathVariable(value = "formacion") String formacion);

    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    @RequestMapping(value = "/idioma/{id}", method = RequestMethod.DELETE, headers = "Accept=application/json")
    @ResponseBody
    void eliminarIdioma(@PathVariable(value = "id") String id);

    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    @RequestMapping(value = "/tContrato/{id}", method = RequestMethod.DELETE, headers = "Accept=application/json")
    @ResponseBody
    void eliminarTipocontrato(@PathVariable(value = "id") String id);

    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    @RequestMapping(value = "/tformacion/{id}", method = RequestMethod.DELETE, headers = "Accept=application/json")
    @ResponseBody
    void eliminarTipoformacion(@PathVariable(value = "id") String id);

    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    @RequestMapping(value = "/user/{id}", method = RequestMethod.DELETE, headers = "Accept=application/json")
    @ResponseBody
    void eliminarUsuario(@PathVariable(value = "id") String id);

    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    @RequestMapping(value = "/cformacion/add", method = RequestMethod.POST, headers = "Accept=application/json")
    @ResponseBody
    void insertarCentroformacion(@RequestBody Centroformacion sp);

    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    @RequestMapping(value = "/comp/add", method = RequestMethod.POST, headers = "Accept=application/json")
    @ResponseBody
    void insertarCompetencia(@RequestBody Competencia sp);

    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    @RequestMapping(value = "/comp/add/{usuario}/{nivel}", method = RequestMethod.POST, headers = "Accept=application/json")
    @ResponseBody
    void insertarCompetenciaUsuario(@RequestBody Competencia sp, @PathVariable(value = "usuario") String usuario, @PathVariable(value = "nivel") String nivel);

    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    @RequestMapping(value = "/elab/add/{usuario}", method = RequestMethod.POST, headers = "Accept=application/json")
    @ResponseBody
    void insertarExperiencialaboral(@RequestBody Experiencialaboral sp, @PathVariable(value = "usuario") String usuario);

    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    @RequestMapping(value = "/formacion/add", method = RequestMethod.POST, headers = "Accept=application/json")
    @ResponseBody
    void insertarFormacion(@RequestBody Formacion sp);

    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    @RequestMapping(value = "/formacion/add/{usuario}/{centro}/{anios}", method = RequestMethod.POST, headers = "Accept=application/json")
    @ResponseBody
    void insertarFormacionUsuario(@RequestBody Formacion sp, @PathVariable(value = "usuario") String usuario, @PathVariable(value = "centro") String centro, @PathVariable(value = "anios") String anios);

    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    @RequestMapping(value = "/idioma/add", method = RequestMethod.POST, headers = "Accept=application/json")
    @ResponseBody
    void insertarIdioma(@RequestBody Idioma sp);

    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    @RequestMapping(value = "/idioma/add/{usuario}/{nivel}", method = RequestMethod.POST, headers = "Accept=application/json")
    @ResponseBody
    void insertarIdiomaUsuario(@RequestBody Idioma sp, @PathVariable(value = "usuario") String usuario, @PathVariable(value = "usuario") String nivel);

    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    @RequestMapping(value = "/sp/add", method = RequestMethod.POST, headers = "Accept=application/json")
    @ResponseBody
    void insertarSectorProfesional(@RequestBody Sectorprofesional sp);

    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    @RequestMapping(value = "/tContrato/add", method = RequestMethod.POST, headers = "Accept=application/json")
    @ResponseBody
    void insertarTipocontrato(@RequestBody Tipocontrato sp);

    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    @RequestMapping(value = "/tformacion/add", method = RequestMethod.POST, headers = "Accept=application/json")
    @ResponseBody
    void insertarTipoformacion(@RequestBody Tipoformacion sp);

    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    @RequestMapping(value = "/user/add", method = RequestMethod.POST, headers = "Accept=application/json")
    @ResponseBody
    void insertarUsuario(@RequestBody Usuario sp);

    @RequestMapping(value = "/cformacion/{id}/{name}/{municipio}", method = RequestMethod.GET)
    @ResponseBody
    List<Centroformacion> obtenerCentroformacion(@PathVariable(value = "id") String id, @PathVariable(value = "name") String name, @PathVariable(value = "municipio") String municipio);

    @RequestMapping(value = "/comp/{generica}/{id}/{name}", method = RequestMethod.GET)
    @ResponseBody
    List<Competencia> obtenerCompetencias(@PathVariable(value = "generica") String generica, @PathVariable(value = "id") String id, @PathVariable(value = "name") String name);

    @RequestMapping(value = "/elab/{sector}/{profesion}/{tipoContrato}/{usuario}", method = RequestMethod.GET)
    @ResponseBody
    List<Experiencialaboral> obtenerExperiencialaboral(@PathVariable(value = "sector") String sector, @PathVariable(value = "profesion") String profesion, @PathVariable(value = "tipoContrato") String tipoContrato, @PathVariable(value = "usuario") String usuario);

    @RequestMapping(value = "/formacion/{id}/{name}/{usuario/{tipo}", method = RequestMethod.GET)
    @ResponseBody
    List<Formacion> obtenerFormacion(@PathVariable(value = "id") String id, @PathVariable(value = "name") String name, @PathVariable(value = "usuario") String usuario, @PathVariable(value = "tipo") String tipo);

    @RequestMapping(value = "/idioma/{id}/{name}", method = RequestMethod.GET)
    @ResponseBody
    List<Idioma> obtenerIdioma(@PathVariable(value = "id") String id, @PathVariable(value = "name") String name);

    @RequestMapping(value = "/municipio/{id}/{name}/{provincia}/{codigoPostal}", method = RequestMethod.GET)
    @ResponseBody
    List<Municipio> obtenerMunicipio(@PathVariable(value = "id") String id, @PathVariable(value = "name") String name, @PathVariable(value = "provincia") String provincia, @PathVariable(value = "codigoPostal") String codigoPostal);

    @RequestMapping(value = "/provincia/{id}/{name}", method = RequestMethod.GET)
    @ResponseBody
    List<Provincia> obtenerProvicia(@PathVariable(value = "id") String id, @PathVariable(value = "name") String name);

    @RequestMapping(value = "/sp/{sppadre}/{id}/{name}", method = RequestMethod.GET)
    @ResponseBody
    List<Sectorprofesional> obtenerSectoresProfesionales(@PathVariable(value = "sppadre") String sppadre, @PathVariable(value = "id") String id, @PathVariable(value = "name") String name);

    @RequestMapping(value = "/tformacion/{id}/{name}", method = RequestMethod.GET)
    @ResponseBody
    List<Tipoformacion> obtenerTipoFormacion(@PathVariable(value = "id") String id, @PathVariable(value = "name") String name);

    @RequestMapping(value = "/tContrato/{id}/{name}", method = RequestMethod.GET)
    @ResponseBody
    List<Tipocontrato> obtenerTipocontrato(@PathVariable(value = "id") String id, @PathVariable(value = "name") String name);

    @RequestMapping(value = "/user/{id}/{name}", method = RequestMethod.GET)
    @ResponseBody
    List<Usuario> obtenerUsuario(@PathVariable(value = "id") String id, @PathVariable(value = "name") String name);
    
}
